<?php
namespace App\Middlewares;
class AuthMiddleware extends BaseMiddleware{
	public function __invoke($request,$response,$next){
//	$response->getBody()->write("AuthMiddleware");

//  var_dump($this->container);
    if($_SESSION["loginName"]==null){
	return $response->withRedirect($this->container->router->pathFor('login'));
    }
	$response=$next($request,$response);
//	$response->getBody()->write("after");
	return $response;
	}
}
